﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using RipPoll.Business;
using RipPoll.Library;
using RipPoll.Services.Contracts;

namespace RipPoll.Services.Library
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class UserServices : IUserServices
    {

        public UserPE GetUserById(int id)
        {
            UserBO ubo = new UserBO();
            return ubo.GetUser(id);
        }

        public UserPE GetUserByEmailId(string emailId)
        {
            UserBO ubo = new UserBO();
            return ubo.GetUserForEmail(emailId);
        }

        public void AddUser(UserPE inUserPE)
        {
            UserBO ubo = new UserBO();
            ubo.AddUser(inUserPE);
            ubo = null;
        }

        public void UpdateUserForPoll(UserPE inUserPE)
        {
            UserBO ubo = new UserBO();
            ubo.UpdateUserForPoll(inUserPE);
        }

        public UserPE GetUserByScreenName(string screenName)
        {
            UserBO ubo = new UserBO();
            return ubo.GetUserForScreenName(screenName);
        }

        public void CheckUserForEmailIdAndScreenName(string emailId, string screenName, out bool EmailExists, out bool ScreenExists)
        {
            UserBO ubo = new UserBO();
            ubo.CheckUserForScreenNameAndEmailId(screenName, emailId, out EmailExists, out ScreenExists);
        }

        public List<EducationNamesPE> GetEducationNames()
        {
            UserBO ubo = new UserBO();
            return ubo.GetEducationNames();
        }



    }
}
